<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!--********************************************************************
* 该示例需要引入 
* ant-design (https://github.com/ant-design/ant-design)
* mapbox-gl-enhance (https://iclient.supermap.io/web/libs/mapbox-gl-js-enhance/1.12.1-10/mapbox-gl-enhance.js)
*********************************************************************-->
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title data-i18n="resources.title_componentsAnimateTextLayer_React"></title>
    <script type="text/javascript" include="react,jquery" src="../js/include-web.js"></script>
    <script
      type="text/javascript"
      include="antd,mapbox-gl-enhance,iclient-mapboxgl-react"
      src="../../dist/mapboxgl/include-mapboxgl.js"
    ></script>
    <style>
      #main {
        margin: 0 auto;
        width: 100%;
        height: 100%;
      }
    </style>
  </head>

  <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
    <div id="main"></div>
    <script type="text/babel">
      var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
      var mapUrl = host + '/iserver/services/map-china/rest/maps/ChinaDark';
      var attribution =
        "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
        " with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" +
        " Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> ";
      var mapOptions = {
        container: 'map',
        style: {
          version: 8,
          sources: {
            'raster-tiles': {
              attribution: attribution,
              type: 'raster',
              tiles: [mapUrl + '/zxyTileImage.png?z={z}&x={x}&y={y}'],
              tileSize: 256
            },
            buildings: {
              type: 'geojson',
              data: 'https://iclient.supermap.io/examples/data/buildings.json'
            }
          },
          layers: [
            {
              id: 'simple-tiles',
              type: 'raster',
              source: 'raster-tiles',
              minzoom: 0,
              maxzoom: 22
            },
            {
              id: '3d-buildings',
              source: 'buildings',
              type: 'fill-extrusion',
              paint: {
                'fill-extrusion-color': [
                  'case',
                  ['<', ['get', 'height'], 2],
                  '#fbb03b',
                  ['<', ['get', 'height'], 4],
                  '#223b53',
                  ['<', ['get', 'height'], 8],
                  '#15D1F2',
                  ['<', ['get', 'height'], 16],
                  '#15D1F2',
                  '#3bb2d0'
                ],
                'fill-extrusion-height': ['*', ['get', 'height'], 5],
                'fill-extrusion-opacity': 0.6
              }
            }
          ]
        },
        center: [116.45678770471238, 39.91985987899349],
        zoom: 14.310035105070941,
        bearing: 0.8568,
        pitch: 60
      };
      var SmWebMap = SuperMap.Components.SmWebMap;
      var SmAnimateMarkerLayer = SuperMap.Components.SmAnimateMarkerLayer;

      $.get('../data/text-marker.json', function(features) {
        ReactDOM.render(
          <SmWebMap mapOptions={mapOptions}>
            <SmAnimateMarkerLayer
              features={features}
              type="rotatingTextBorder"
              textField="NAME"
              colors={['rgb(21, 209, 242)', 'rgba(21, 209, 242, 0.56)']}
              width={150}
              fitBounds={false}
            />
          </SmWebMap>,
          document.getElementById('main')
        );
      });
    </script>
  </body>
</html>
